import request from '@/utils/request'

export function getWarehouse(data) {
  return request({
    url: '/core/baseWarehouse/query',
    method: 'post',
    data: data
  })
}

/**
 * @author LiHuaibei
 * @date 2024/6/16 23:47
 * @description
 * @param null 1
 * @return 获取客户信息
 * @throws
 */
export function getCustomer(data) {
  return request({
    url: '/web/condition/customerList',
    method: 'post',
    data: data
  })
}

/**
 * 查询器材列表
 * @param data
 * @returns {AxiosPromise}
 */
export function getBaseEquipmentType(data) {
  return request({
    url: '/core/baseEquipmentType/query',
    method: 'post',
    data: data
  })
}


/**
 * 查询器材列表（以列表方式展示，不是树形结构）
 * @param data
 * @returns {AxiosPromise}
 */
 export function getBaseEquipmentTypeList(data) {
  return request({
    url: '/core/baseEquipmentType/queryListCon',
    method: 'post',
    data: data
  })
}

/**
 * 停用某个器材
 * @param data
 * @returns {AxiosPromise}
 */
export function setEquipmentStop(data) {
  return request({
    url: '/core/baseEquipmentType/setStop',
    method: 'post',
    data: data
  })
}

/**
 * 添加器材分类
 * @param data
 * @returns {AxiosPromise}
 */
export function addEquipmentType(data) {
  return request({
    url: '/core/baseEquipmentType/add',
    method: 'post',
    data: data
  })
}

/**
 * 获取器材分类详情
 * @param data
 * @returns {AxiosPromise}
 */
export function queryDetailById(data) {
  return request({
    url: '/core/baseEquipmentType/queryDetailById',
    method: 'post',
    data: data
  })
}

export function queryEquipmentDetailById(data) {
  return request({
    url: '/core/baseEquipmentDetails/query',
    method: 'post',
    data: data
  })
}

export function addEquipmentDetail(data) {
  return request({
    url: '/core/baseEquipmentDetails/add',
    method: 'post',
    data: data
  })
}

export function getEquipmentWarningSet(data) {
  return request({
    url: '/core/baseEquipmentWarningSet/query',
    method: 'post',
    data: data
  })
}

export function setEquipmentWarningSet(data) {
  return request({
    url: '/core/baseEquipmentWarningSet/add',
    method: 'post',
    data: data
  })
}

export function getTypes(data) {
  return request({
    url: '/core/baseTypes/queryByTypeId',
    method: 'post',
    data: data
  })
}

/**
 * 入库列表
 * @param data
 * @returns {AxiosPromise}
 */
export function getWarehouseInList(data) {
  return request({
    url: '/back/web/inList',
    method: 'post',
    data: data
  })
}

/**
 * 获得入库单号
 * @param data
 * @returns {AxiosPromise}
 */
export function getWarehouseInNo(data) {
  return request({
    url: '/core/busIn/getInNo',
    method: 'post',
    data: data
  })
}


//搜索条件获取批次号
export function getBatchNos(data) {
  return request({
    url: '/core/busIn/getBatchNos',
    method: 'post',
    data: data
  })
}


//搜索条件获取收货地单号
export function getReceiveNos(data) {
  return request({
    url: '/back/web/getReceiveNos',
    method: 'post',
    data: data
  })
}

export function delWarehouseIn(data) {
  return request({
    url: '/core/busIn/del',
    method: 'post',
    data: data
  })
}



export function addWarehouseIn(data) {
  return request({
    url: '/back/web/inUpdate',
    method: 'post',
    data: data
  })
}

export function getWarehouseExNo(data) {
  return request({
    url: '/core/busOut/getOutNo',
    method: 'post',
    data: data
  })
}

export function getWarehouseExList(data) {
  return request({
    url: '/back/web/outList',
    method: 'post',
    data: data
  })
}

export function addWarehouseEx(data) {
  return request({
    url: '/web/pda/busOutAdd',
    method: 'post',
    data: data
  })
}


export function updateWarehouseEx(data) {
  return request({
    url: '/back/web/outUpdate',
    method: 'post',
    data: data
  })
}

export function delWarehouseEx(data) {
  return request({
    url: '/core/busOut/del',
    method: 'post',
    data: data
  })
}

export function getActualStock(data) {
  return request({
    url: '/core/busStock/getActualStock',
    method: 'post',
    data: data
  })
}

export function getWarehouseReturns(data) {
  return request({
    url: '/core/busOut/returnQuery',
    method: 'post',
    data: data
  })
}

export function getExceptionList(data) {
  return request({
    url: '/core/busOut/getExceptionList',
    method: 'post',
    data: data
  })
}

export function handleException(data) {
  return request({
    url: '/core/busOut/operException',
    method: 'post',
    data: data
  })
}

export function returnAdd(data) {
  return request({
    url: '/core/busOut/returnAdd',
    method: 'post',
    data: data
  })
}

export function getUpImagUrl() {
  return process.env.VUE_APP_BASE_API + '/core/baseEquipmentDetails/upImg'
}

export function getShowImagUrl(path) {
  return process.env.VUE_APP_BASE_API + '/core/baseEquipmentDetails/showImg?name=' + path
}


//信息查询列表
 export function getQueryList(data) {
  return request({
    url: '/core/query/getList',
    method: 'post',
    data: data
  })
}

//信息查询-设备监控跟踪详情
 export function getMonitoringInfo(data) {
  return request({
    url: '/core/query/getMonitoringInfo',
    method: 'post',
    data: data
  })
}

//--------------------分割--------------------
//库存管理-列表
export function getStockList(data) {
  return request({
    url: '/core/busStock/getList',
    method: 'post',
    data: data
  })
}

//库存管理-库存明细列表（库存和在库）
export function getDetailList(data) {
  return request({
    url: '/core/busStock/getDetailList',
    method: 'post',
    data: data
  })
}

//库存管理-库存明细列表（在外）
export function getDetailOutList(data) {
  return request({
    url: '/core/busStock/getDetailOutList',
    method: 'post',
    data: data
  })
}

//库存管理-库存明细列表（失效/报废）
export function getDetailScrapList(data) {
  return request({
    url: '/core/busStock/getDetailScrapList',
    method: 'post',
    data: data
  })
}



//--------------------分割--------------------
//数据展示-头部综合展示DIV数据获取
export function getDBType(data) {
  return request({
    url: '/core/dbShow/queryDBType',
    method: 'post',
    data: data
  })
}

//数据展示-中左，出库频率统计数据获取
export function getOutFrequency(data) {
  return request({
    url: '/core/dbShow/queryOutFrequency',
    method: 'post',
    data: data
  })
}

//数据展示-中右，报废排名数据获取
export function getScrapSort(data) {
  return request({
    url: '/core/dbShow/queryScrapSort',
    method: 'post',
    data: data
  })
}
